/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.inspur.edp.udt.generator.core.rtgenerator.manager;


import com.inspur.edp.caf.generator.BaseGenerator;
import com.inspur.edp.caf.generator.composite.CompositeGeneratorContext;
import com.inspur.edp.cef.generator.coreGenerator.base.accessorcreatorgen.AccessorCreatorGenerator;
import com.inspur.edp.cef.generator.coreGenerator.base.entitygen.EntityGenerator;
import com.inspur.edp.cef.generator.coreGenerator.base.mgrGenerator.DataManagerImplGenerator;
import com.inspur.edp.cef.generator.coreGenerator.base.mgrGenerator.ManagerGenerator;
import com.inspur.edp.cef.generator.coreGenerator.base.serializer.changeser.valueobject.ValueObjChangeSerGenerator;
import com.inspur.edp.udt.generator.core.UdtCoreGenCtx;
import com.inspur.edp.udt.generator.core.rtgenerator.entity.UdtEntityGenerator;
import com.inspur.edp.udt.generator.core.rtgenerator.manager.acccessorcreator.UdtAccessorCreatorGenerator;
import java.util.ArrayList;

public class UdtMgrGenerator extends ManagerGenerator
{
	private UdtCoreGenCtx coreGenCtx;
	public UdtMgrGenerator(UdtCoreGenCtx coreGenCtx)
	{
		super(coreGenCtx);
		this.coreGenCtx = coreGenCtx;
	}

//C# TO JAVA CONVERTER WARNING: There is no Java equivalent to C#'s shadowing via the 'new' keyword:
//ORIGINAL LINE: private new UdtMgrGenCtx Context => (UdtMgrGenCtx)super.Context;
	private UdtMgrGenCtx getUdtMgrGenContext(){return (UdtMgrGenCtx)super.getContext();}

	@Override
	protected AccessorCreatorGenerator createAccessorCreatorImplGenerator()
	{
		return new UdtAccessorCreatorGenerator(getUdtMgrGenContext());
	}

	@Override
	protected CompositeGeneratorContext createCompositeContext()
	{
		return new UdtMgrGenCtx(coreGenCtx);
	}

	@Override
	protected EntityGenerator createEntityGenerator()
	{
		return new UdtEntityGenerator(getUdtMgrGenContext());
	}

	@Override
	protected DataManagerImplGenerator createMgrImplGenerator()
	{
		return new UdtManagerImplGenerator(getUdtMgrGenContext());
	}

	@Override
	protected void addExtendCompositeItemGenerators(
			ArrayList<BaseGenerator> compositeItemGenerators) {
		super.addExtendCompositeItemGenerators(compositeItemGenerators);
		compositeItemGenerators.add(new ValueObjChangeSerGenerator(getUdtMgrGenContext()));
	}
}
